/**
  ******************************************************************************
  * @file    alarm_timing.h
  * @author  Sherlock
  * @version V0.1
  * @date    10/12/2023
  * @brief   Alarm timing handling head file.
  ******************************************************************************
  * @copy
  *
  * <h2><center>&copy; COPYRIGHT 2010 Feirui</center></h2>
  */ 



/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef  __ALARM_TIMING_H__
#define  __ALARM_TIMING_H__


#ifdef __cplusplus
 extern "C" {
#endif


/**
  * @brief  INCLUDE FILES.
  */


/**
  * @brief GLOBALS RAM definition
  */
#ifdef   ALARM_TIMING_GLOBALS
#define  ALARM_TIMING_EXT
#else
#define  ALARM_TIMING_EXT  extern
#endif


#define AlarmInputTimingFreq                  10     /* 10HZ  */

uint8_t Alarm_GenFreqInputAction(void);
uint8_t Alarm_GenFreqTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_GenVoltInputAction(void);
uint8_t Alarm_GenVoltTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_LoadVoltInputAction(void);
uint8_t Alarm_LoadVoltTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_GenCurrInputAction(void);
uint8_t Alarm_GenCurrTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_GenExciteInputAction(void);
uint8_t Alarm_GenExciteTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_LoadExciteInputAction(void);
uint8_t Alarm_LoadExciteTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_SyncInputAction(void);
uint8_t Alarm_SyncTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

uint8_t Alarm_PowerInputAction(void);
uint8_t Alarm_PowerTimingHandle(NominalCfg_ST *TempNominalCfg, SeriousAlarmCfg_ST *TempAlarmCfg);

typedef struct
{
    uint8_t AlarmStatus;
    uint16_t AlarmCnt;
} AlarmTimingUnitTypeDef;

// ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenFreqLowTiming;       //发电频率低检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenVoltHighTiming;      //发电过压检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenCurrHighTiming;      //发电过流检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenAcPowerHighTiming;   //有功过功率检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenRePowerHighTiming;   //无功过功率检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenExVoltHighTiming;    //AVR励磁过压
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenExCurrHighTiming;    //AVR励磁过流
ALARM_TIMING_EXT AlarmTimingUnitTypeDef GenPFLowTiming;         //PF过低检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef LoadVoltHighTiming;     //负载机发电过压检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef LoadExVoltHighTiming;   //负载机励磁过压
ALARM_TIMING_EXT AlarmTimingUnitTypeDef LoadExCurrHighTiming;   //负载机励磁过流
ALARM_TIMING_EXT AlarmTimingUnitTypeDef SyncVoltTiming;         //同步电压检测
ALARM_TIMING_EXT AlarmTimingUnitTypeDef SyncPhaseTiming;        //同步相位检测
ALARM_TIMING_EXT void Alarm_InitTimingAlarmStatus(AlarmTimingUnitTypeDef *AlarmTiming);



#ifdef __cplusplus
}
#endif


#endif   /*  __ACAD_TIMING_H__  */

/******************* (C) COPYRIGHT 2010 Feirui *****END OF FILE****/